package com.example.zoo;

import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;

public class MapChoice extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_map_choice);
        
		Bundle extra = this.getIntent().getExtras();
		if(extra != null){
			if(extra.getString("back") != null){
			}else AppManager.getAppManager().addActivity(this);
		}else AppManager.getAppManager().addActivity(this);

		Log.v("appstack", AppManager.getAppManager().getSize()+"");        
    }
    
	public void toShare(View vue){
		Uri shareonfb = Uri.parse("http://www.facebook.com/sharer/sharer.php?u=http://www.mairie-lille.fr/cms/accueil/sport-loisirs/zoo-lille&t=Parc zoologique de Lille");
		Intent intent = new Intent(Intent.ACTION_VIEW, shareonfb);
		startActivity(intent);
	}
	
	public void toBack(View vue){
		Log.v("appstack1", AppManager.getAppManager().getSize()+"");
		Activity previousActivity = AppManager.getAppManager().previousActivity();
		Intent intent = new Intent(this, previousActivity.getClass());
		intent.putExtra("back", "back");
		AppManager.getAppManager().finishActivity();
		Log.v("appstack2", AppManager.getAppManager().getSize()+"");
		startActivity(intent);
	}
	
	public void toGoogleMap(View vue){
		startActivity(new Intent(this, Map.class));
	}
    

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_map_choice, menu);
        return true;
    }
}
